import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import './assets/css/global.css'
import ElementUI from 'element-plus'
import 'element-plus/theme-chalk/index.css'
import * as ElIconModules from '@element-plus/icons-vue'
import axios from 'axios'

//配置请求根路径
axios.defaults.baseURL = '/api/'
axios.interceptors.request.use(config => {
    config.headers.Authorization = window.sessionStorage.getItem('token')
    return config
})
const app = createApp(App)
app.config.globalProperties.$http = axios
app.use(store).use(router).use(ElementUI).mount('#app')
for(let iconName in ElIconModules){
    app.component(iconName,ElIconModules[iconName])
}